{extend name="/fool" /}
{block name="menu_content"}
<style>
    #content .li{
        float:left;
        width:90vw;
        margin: 5vh 5vw;
    }
    .value{
        display: block;
        margin:1vh 0;
    }
    #content .one .one-one{
        text-align: right;
    }
    .fh{
        margin-left:20px;
    }
    .td_content div{
        width:200px;
        padding:0 20px;
        word-wrap:break-word;
    }
</style>
<div id="dh" style="display:none;position: absolute;width:200px;height:150px;box-shadow: 0 0 5px 0 rgba(0,0,0,0.5);background: #fff;text-align: center;border-radius: 10px;left:50%;top:50%;margin-top: -75px;margin-left: -100px;">
    <div style="font-size: 20px;margin-top: 20px;">运单号</div>
    <input id="input" type="text" required style="margin: 15px 0;">
    <button type="button" class="fhs layui-btn">发货</button>
</div>
<ul id="content">
    <li class="li">
        <table class="one"  style="float: left;">
            <tr>
                <td class="one-one">订单号：</td>
                <td class="value">{$list['orderid']}</td>
            </tr>
            <tr>
                <td class="one-one">下单时间：</td>
                <td class="value">{$list['create_time']}</td>
            </tr>
            <tr>
                <td class="one-one">订单进度：</td>
                <td class="value">
                    {if $list['status'] == 10}
                    待付款
                    {elseif $list['status'] == 20}
                    待发货
                    {elseif $list['status'] == 30}
                    待收货
                    {elseif $list['status'] == 40}
                    已完成
                    {elseif $list['status'] == 50}
                    已取消
                    {/if}
                </td>
            </tr>
            <tr>
                {if $list['gl']}
                <td class="one-one">商品：</td>
                <td class="">
                    <img style="height:150px;" src=" {$list['gl']['images']}" alt="">
                </td>
                <td class="td_content">
                    <div>
                        {$list['gl']['title']}
                    </div>
                </td>
                <td class="">
                    <div style="font-size: 15px;font-weight: bold;"><i class="fa fa-jpy" aria-hidden="true"></i>{$list['money']}</div>
                    <div style="text-align:right;font-size: 10px;font-weight: 100;"><i class="fa fa-times" aria-hidden="true"></i>{$list['num']}</div>
                </td>
                {/if}
            </tr>
            <tr>
                <td class="one-one">直属上级：</td>
                <td class="value">
                	{if $list['parent_id'] == 0}
                	无
                	{else}
                	{$list['parent_id']}
                	{/if}
                </td>
            </tr>
            <tr>
                <td class="one-one">最高上级：</td>
                <td class="value">
                	{if $list['zg'] == 0}
                	无
                	{else}
                	{$list['zg']}
                	{/if}
                </td>
            </tr>
            <tr>
                <td class="one-one">买家：</td>
                <td class="value">{$list['user']['name']}</td>
            </tr>
            <tr>
                <td class="one-one">收件人姓名：</td>
                <td class="value">{$list['addressee']}</td>
            </tr>
            <tr>
                <td class="one-one">手机号码：</td>
                <td class="value">{$list['phone']}</td>
            </tr>
            <tr>
                <td class="one-one">详细地址：</td>
                <td class="value">{$list['address']}</td>
            </tr>
            <tr>
                {if $list['status'] != 10 && $list['status'] != 20}
                <td class="one-one">运单号：</td>
                <td class="value">{$list['waybill']}</td>
                {/if}
            </tr>
            <tr>
                <td class="one-one">
                    <button type="button" class="listbu layui-btn">返回</button>
                </td>
                <td class="value">
                    {if $list['status'] == 20}
                    <button type="button" class="fh layui-btn">发货</button>
                    {/if}
                </td>
            </tr>
        </table>
        <div style="float: right;">
            <table style="float: right;width: 20vw;">
                <tr>
                    <td style="color: #409EFF;">操作记录</td>
                </tr>
                {foreach $record as $v}
                <tr>
                    <td>{$v.create_time}</td>
                    <td>{$v.title}</td>
                </tr>
                {/foreach}
            </table>
            <div style="clear: both;"></div>
            <style>
                #mx td{
                    border: 1px solid #000;
                }
                #mx .tda{
                    width:30%;
                }
                #mx .tdb{
                     width:70%;
                }
            </style>
            <table id="mx" style="float: right;width: 20vw;text-align: center;">
                <tr>
                    <td class="tda">类型</td>
                    <td class="tdb">明细</td>
                </tr>
                {foreach $integral as $v}
                <tr>
                    <td>{$v.source}</td>
                    <td>{$v.num}</td>
                </tr>
                {/foreach}
            </table>
        </div>
    </li>
</ul>
<script>
    $(".listbu").click(function(){
        history.back(-1);
    })
    $(".fh").click(function(){
        $("#dh").show();
    })
    $(".fhs").click(function(){
        var waybill = $("#input").val();
        if(waybill.length<1){
            layui.use('layer', function(){
                var layer = layui.layer;
                layer.msg("内容不能为空");
            });
        }else{
            $.post("{:url('update')}",{
                id:"{$list['id']}",
                waybill:waybill
            },function (res) {
                history.go(0);
            },'json');
        }
    })
</script>
{/block}